{"ast":null,"code":"import { makeAutoObservable } from \"mobx\";\nimport { UserService, AuthService, ChatService, MessageService } from \"../services/\";\nimport axios from \"axios\";\nimport { refreshToken } from \"../routes\";\nimport ContentService from \"../services/ContentService\";\nimport ContactService from \"../services/ContactService\";\nexport default class Store {\n  constructor() {\n    this.isAuth = false;\n    this.profile = {};\n    this.chats = {};\n    this.currentDialog = {};\n    this.viewedDialogId = null;\n    this.contacts = {};\n    this.viewedUserProfile = {};\n    this.viewedUserProfileId = null;\n    this.uploadedContentForChats = {};\n    this.dialogInput = {};\n    this.isLoading = false;\n    this.isError = false;\n    this.getAuth = () => {\n      return this.isAuth;\n    };\n    this.getLoading = () => {\n      return this.isLoading;\n    };\n    this.logout = () => {\n      this.removeTokensTolLocalStorage();\n      this.setAuth(false);\n      this.setProfile({});\n    };\n    makeAutoObservable(this);\n  }\n  setAuth(bool) {\n    this.isAuth = bool;\n  }\n  getProfile() {\n    return this.profile;\n  }\n  setProfile(profile) {\n    this.profile = profile;\n  }\n  getChats() {\n    return this.chats;\n  }\n  setChats(chats) {\n    this.chats = chats;\n  }\n  getCurrentDialog() {\n    return this.currentDialog;\n  }\n  setCurrentDialog(currentDialog) {\n    this.currentDialog = currentDialog;\n  }\n  getViewedDialogId() {\n    return this.viewedDialogId;\n  }\n  setViewedDialogId(viewedDialogId) {\n    this.viewedDialogId = viewedDialogId;\n  }\n  getUploadedContentForChats() {\n    return this.uploadedContentForChats;\n  }\n  setUploadedContentForChats(uploaded) {\n    this.uploadedContentForChats = uploaded;\n  }\n  getDialogInput() {\n    return this.dialogInput;\n  }\n  setDialogInput(dialogInput) {\n    this.dialogInput = dialogInput;\n  }\n  getViewedUserProfile() {\n    return this.viewedUserProfile;\n  }\n  setViewedUserProfile(viewedUserProfile) {\n    this.viewedUserProfile = viewedUserProfile;\n  }\n  getViewedUserProfileId() {\n    return this.viewedUserProfileId;\n  }\n  setViewedUserProfileId(viewedUserProfileId) {\n    this.viewedUserProfileId = viewedUserProfileId;\n  }\n  getContacts() {\n    return this.contacts;\n  }\n  setContacts(contacts) {\n    this.contacts = contacts;\n  }\n  setLoading(bool) {\n    this.isLoading = bool;\n  }\n  setIsError(bool) {\n    this.isError = bool;\n  }\n  getIsError() {\n    return this.isError;\n  }\n  setTokensTolLocalStorage(response) {\n    localStorage.setItem(`${process.env.REACT_APP_NAME_TOKEN}`, response.data.token);\n    localStorage.setItem(`${process.env.REACT_APP_NAME_REFRESH_TOKEN}`, response.data.refresh_token);\n  }\n  removeTokensTolLocalStorage() {\n    localStorage.removeItem(`${process.env.REACT_APP_NAME_TOKEN}`);\n    localStorage.removeItem(`${process.env.REACT_APP_NAME_REFRESH_TOKEN}`);\n  }\n  async getProfileFromAPI() {\n    try {\n      const response = await UserService.profile();\n      this.setProfile(response.data);\n    } catch (e) {\n      this.removeTokensTolLocalStorage();\n    }\n  }\n  async signIn(request) {\n    try {\n      const response = await AuthService.signIn(request);\n      this.setTokensTolLocalStorage(response);\n      this.setAuth(true);\n      await this.getProfileFromAPI();\n    } catch (e) {\n      this.setIsError(true);\n    } finally {\n      setTimeout(() => {\n        this.setIsError(false);\n      }, 5000);\n    }\n  }\n  async signUp(request) {\n    try {\n      const response = await AuthService.signUp(request);\n      this.setTokensTolLocalStorage(response);\n      this.setAuth(true);\n      await this.getProfileFromAPI();\n    } catch (e) {\n      this.setIsError(true);\n    } finally {\n      setTimeout(() => {\n        this.setIsError(false);\n      }, 5000);\n    }\n  }\n  async forgotPassword(request) {\n    try {\n      await AuthService.forgotPassword(request);\n    } catch (e) {\n      this.setIsError(true);\n    }\n  }\n  async checkAuth() {\n    this.setLoading(true);\n    try {\n      const response = await axios.post(refreshToken(), {\n        \"refresh_token\": localStorage.getItem(`${process.env.REACT_APP_NAME_REFRESH_TOKEN}`)\n      });\n      this.setTokensTolLocalStorage(response);\n      this.setAuth(true);\n      await this.getProfileFromAPI();\n    } catch (e) {\n      this.removeTokensTolLocalStorage();\n      this.setIsError(true);\n    } finally {\n      this.setLoading(false);\n    }\n  }\n  async getChatsFromAPI() {\n    try {\n      return await ChatService.getChatsList().then(res => this.setChats(res.data));\n    } catch (e) {\n      var _e$response, _e$response$data;\n      if ((_e$response = e.response) !== null && _e$response !== void 0 && (_e$response$data = _e$response.data) !== null && _e$response$data !== void 0 && _e$response$data.message) {\n        console.error(e.response.data.message);\n      }\n    }\n  }\n  async deleteProfileFromAPI() {\n    try {\n      this.setLoading(true);\n      await UserService.deleteProfile().then(res => {\n        if (res.data.request_status) {\n          this.logout();\n        }\n      });\n    } catch (e) {\n      var _e$response2, _e$response2$data;\n      if ((_e$response2 = e.response) !== null && _e$response2 !== void 0 && (_e$response2$data = _e$response2.data) !== null && _e$response2$data !== void 0 && _e$response2$data.message) {\n        console.error(e.response.data.message);\n      }\n    } finally {\n      this.setLoading(false);\n    }\n  }\n  async updateProfileFromAPI(profileRequest) {\n    try {\n      await UserService.updateProfile(profileRequest).then(res => {\n        if (res.status === 200) {\n          this.setProfile({\n            ...this.getProfile(),\n            ...res.data\n          });\n          this.setIsError(false);\n        }\n      });\n    } catch (e) {\n      var _e$response3, _e$response3$data;\n      if ((_e$response3 = e.response) !== null && _e$response3 !== void 0 && (_e$response3$data = _e$response3.data) !== null && _e$response3$data !== void 0 && _e$response3$data.message) {\n        this.setIsError(true);\n        console.error(e.response.data.message);\n      }\n    } finally {\n      setTimeout(() => {\n        this.setIsError(false);\n      }, 5000);\n    }\n  }\n  async uploadAvatar(file) {\n    try {\n      const formData = new FormData();\n      formData.append('avatar', file);\n      await UserService.uploadAvatar(formData).then(res => {\n        if (res.status === 200) {\n          var _this$getProfile$cont;\n          const profileContents = {\n            items: ((_this$getProfile$cont = this.getProfile().content) === null || _this$getProfile$cont === void 0 ? void 0 : _this$getProfile$cont.items.slice()) || []\n          };\n\n          // @ts-ignore\n          profileContents.items.push(res.data);\n          this.setProfile({\n            ...this.getProfile(),\n            content: profileContents\n          });\n        }\n      });\n    } catch (e) {\n      var _e$response4, _e$response4$data;\n      if ((_e$response4 = e.response) !== null && _e$response4 !== void 0 && (_e$response4$data = _e$response4.data) !== null && _e$response4$data !== void 0 && _e$response4$data.message) {\n        console.error(e.response.data.message);\n      }\n    }\n  }\n  async deleteUserAvatarFromAPI(data, index) {\n    try {\n      await ContentService.deleteContent(data).then(res => {\n        var _this$getProfile$cont2;\n        if (res.status === 200 && data.id && data.avatar && (_this$getProfile$cont2 = this.getProfile().content) !== null && _this$getProfile$cont2 !== void 0 && _this$getProfile$cont2.items) {\n          var _this$getProfile$cont3;\n          const profileContents = {\n            items: ((_this$getProfile$cont3 = this.getProfile().content) === null || _this$getProfile$cont3 === void 0 ? void 0 : _this$getProfile$cont3.items.slice()) || []\n          };\n          profileContents.items.splice(index, 1);\n          this.setProfile({\n            ...this.getProfile(),\n            content: profileContents\n          });\n        }\n      });\n    } catch (e) {\n      var _e$response5, _e$response5$data;\n      if ((_e$response5 = e.response) !== null && _e$response5 !== void 0 && (_e$response5$data = _e$response5.data) !== null && _e$response5$data !== void 0 && _e$response5$data.message) {\n        console.error(e.response.data.message);\n      }\n    }\n  }\n  async deleteChatAvatarFromAPI(data, index, chatsListItem) {\n    try {\n      await ContentService.deleteContent(data).then(res => {\n        if (res.status === 200 && data.id && data.avatar) {\n          const chats = {\n            items: this.getChats().items.slice() || []\n          };\n          chats.items.forEach((chat, indexChat) => {\n            if (chatsListItem.id === chat.id) {\n              var _chats$items$indexCha;\n              (_chats$items$indexCha = chats.items[indexChat].content) === null || _chats$items$indexCha === void 0 ? void 0 : _chats$items$indexCha.items.splice(index, 1);\n            }\n          });\n          this.setChats({\n            ...this.getChats(),\n            items: chats.items\n          });\n        }\n      });\n    } catch (e) {\n      var _e$response6, _e$response6$data;\n      if ((_e$response6 = e.response) !== null && _e$response6 !== void 0 && (_e$response6$data = _e$response6.data) !== null && _e$response6$data !== void 0 && _e$response6$data.message) {\n        console.error(e.response.data.message);\n      }\n    }\n  }\n  async getContactsFromAPI() {\n    try {\n      await ContactService.getContacts().then(res => {\n        if (res.status === 200) {\n          this.setContacts({\n            ...this.getContacts(),\n            ...res.data\n          });\n        }\n      });\n    } catch (e) {\n      var _e$response7, _e$response7$data;\n      if ((_e$response7 = e.response) !== null && _e$response7 !== void 0 && (_e$response7$data = _e$response7.data) !== null && _e$response7$data !== void 0 && _e$response7$data.message) {\n        console.error(e.response.data.message);\n      }\n    }\n  }\n  async addContactFromAPI(contactId) {\n    try {\n      await ContactService.addContact(contactId).then(res => {\n        if (res.status === 200) {\n          const contactsList = {\n            items: this.getContacts().items.slice() || []\n          };\n\n          // @ts-ignore\n          contactsList.items.push(res.data);\n          this.setContacts({\n            ...this.getContacts(),\n            ...contactsList\n          });\n        }\n      });\n    } catch (e) {\n      var _e$response8, _e$response8$data;\n      if ((_e$response8 = e.response) !== null && _e$response8 !== void 0 && (_e$response8$data = _e$response8.data) !== null && _e$response8$data !== void 0 && _e$response8$data.message) {\n        console.error(e.response.data.message);\n      }\n    }\n  }\n  async acceptContactFromAPI(contact, index) {\n    try {\n      if (contact.id) {\n        await ContactService.acceptContact(contact.id).then(res => {\n          if (res.status === 200) {\n            const contactsList = {\n              items: this.getContacts().items.slice() || []\n            };\n            if (contactsList.items[index]) {\n              contactsList.items[index].status = true;\n            }\n            this.setContacts({\n              ...this.getContacts(),\n              ...contactsList\n            });\n          }\n        });\n      }\n    } catch (e) {\n      var _e$response9, _e$response9$data;\n      if ((_e$response9 = e.response) !== null && _e$response9 !== void 0 && (_e$response9$data = _e$response9.data) !== null && _e$response9$data !== void 0 && _e$response9$data.message) {\n        console.error(e.response.data.message);\n      }\n    }\n  }\n  async deleteContactFromAPI(contact, index) {\n    try {\n      if (contact.id) {\n        await ContactService.deleteContact(contact.id).then(res => {\n          if (res.status === 200) {\n            const contactsList = {\n              items: this.getContacts().items.slice() || []\n            };\n            contactsList.items.splice(index, 1);\n            this.setContacts({\n              ...this.getContacts(),\n              ...contactsList\n            });\n          }\n        });\n      }\n    } catch (e) {\n      var _e$response10, _e$response10$data;\n      if ((_e$response10 = e.response) !== null && _e$response10 !== void 0 && (_e$response10$data = _e$response10.data) !== null && _e$response10$data !== void 0 && _e$response10$data.message) {\n        console.error(e.response.data.message);\n      }\n    }\n  }\n  async getDialogOrNewFromAPI(otherUser) {\n    try {\n      let chat = {};\n      await ChatService.getDialogOrNew(otherUser.id).then(res => {\n        if (res.status === 200) {\n          const chatsList = {\n            items: this.getChats().items.slice() || []\n          };\n          let flag = false;\n          chatsList.items.forEach(item => {\n            if (item.id === res.data.id) {\n              chat = item;\n              flag = true;\n            }\n          });\n          if (!flag) {\n            // @ts-ignore\n            chatsList.items.push(res.data);\n            this.setChats({\n              ...this.getChats(),\n              ...chatsList\n            });\n            chat = res.data;\n          }\n        }\n      });\n      return chat;\n    } catch (e) {\n      var _e$response11, _e$response11$data;\n      if ((_e$response11 = e.response) !== null && _e$response11 !== void 0 && (_e$response11$data = _e$response11.data) !== null && _e$response11$data !== void 0 && _e$response11$data.message) {\n        console.error(e.response.data.message);\n      }\n    }\n  }\n  async getNewMultiDialogFromAPI() {\n    let chatRequest = {};\n    chatRequest.name = `new MultiDialog By ${this.getProfile().nickname ? this.getProfile().nickname : ''}`;\n    try {\n      await ChatService.getNewMultiDialog(chatRequest).then(res => {\n        if (res.status === 200) {\n          let chatsList = {\n            items: this.getChats().items.slice() || []\n          };\n          // @ts-ignore\n          chatsList.items.push(res.data);\n          this.setChats({\n            ...this.getChats(),\n            ...chatsList\n          });\n        }\n      });\n    } catch (e) {\n      var _e$response12, _e$response12$data;\n      if ((_e$response12 = e.response) !== null && _e$response12 !== void 0 && (_e$response12$data = _e$response12.data) !== null && _e$response12$data !== void 0 && _e$response12$data.message) {\n        console.error(e.response.data.message);\n      }\n    }\n  }\n  async deleteChatFromAPI(chat) {\n    try {\n      await ChatService.deleteChat(chat.id.toString()).then(res => {\n        if (res.status === 200) {\n          let chatsList = {\n            items: this.getChats().items.slice() || []\n          };\n          chatsList.items.forEach((chatItem, indexChat) => {\n            if (chatItem.id === chat.id) {\n              console.log(true);\n              chatsList.items.splice(indexChat, 1);\n            }\n          });\n          console.log(chatsList);\n          if (this.getViewedDialogId() === chat.id) {\n            this.setViewedDialogId(null);\n          }\n          if (this.getCurrentDialog().id === chat.id) {\n            this.setCurrentDialog({});\n          }\n          this.setChats({\n            ...this.getChats(),\n            ...chatsList\n          });\n        }\n      });\n    } catch (e) {\n      var _e$response13, _e$response13$data;\n      if ((_e$response13 = e.response) !== null && _e$response13 !== void 0 && (_e$response13$data = _e$response13.data) !== null && _e$response13$data !== void 0 && _e$response13$data.message) {\n        console.error(e.response.data.message);\n      }\n    }\n  }\n  async uploadFiles(collectionFiles) {\n    try {\n      const chatId = this.getViewedDialogId() || 0;\n      let chatsWithUploaded = {\n        items: this.getUploadedContentForChats().items ? this.getUploadedContentForChats().items.slice() : []\n      };\n      if (!chatsWithUploaded.items[chatId]) {\n        chatsWithUploaded.items[chatId] = {\n          uploadedContent: {\n            items: []\n          }\n        };\n      }\n      collectionFiles.map(async file => {\n        const formData = new FormData();\n        if (file.type.includes(\"image\")) {\n          formData.append('image', file);\n          await ContentService.uploadImage(formData).then(res => {\n            if (res.status === 200) {\n              // @ts-ignore\n              chatsWithUploaded.items[chatId].uploadedContent.items.push(res.data);\n              this.setUploadedContentForChats({\n                ...this.getUploadedContentForChats(),\n                ...chatsWithUploaded\n              });\n            }\n          });\n        } else {\n          formData.append('file', file);\n          await ContentService.uploadFile(formData).then(res => {\n            if (res.status === 200) {\n              // @ts-ignore\n              chatsWithUploaded.items[chatId].uploadedContent.items.push(res.data);\n              this.setUploadedContentForChats({\n                ...this.getUploadedContentForChats(),\n                ...chatsWithUploaded\n              });\n            }\n          });\n        }\n      });\n    } catch (e) {\n      var _e$response14, _e$response14$data;\n      if ((_e$response14 = e.response) !== null && _e$response14 !== void 0 && (_e$response14$data = _e$response14.data) !== null && _e$response14$data !== void 0 && _e$response14$data.message) {\n        console.error(e.response.data.message);\n      }\n    }\n  }\n  async deleteUploadedContent(chatId, contentId) {\n    let contentListItem = {};\n    const tempUploadedContent = this.getUploadedContentForChats() ? {\n      ...this.getUploadedContentForChats()\n    } : {\n      items: []\n    };\n    if (tempUploadedContent.items[chatId]) {\n      tempUploadedContent.items[chatId].uploadedContent.items.forEach((item, index) => {\n        if (item.id === contentId) {\n          contentListItem = {\n            ...item\n          };\n          tempUploadedContent.items[chatId].uploadedContent.items.splice(index, 1);\n        }\n      });\n    }\n    this.setUploadedContentForChats({\n      ...this.getUploadedContentForChats(),\n      ...tempUploadedContent\n    });\n    if (contentListItem) {\n      try {\n        await ContentService.deleteContent(contentListItem).then();\n      } catch (e) {\n        var _e$response15, _e$response15$data;\n        if ((_e$response15 = e.response) !== null && _e$response15 !== void 0 && (_e$response15$data = _e$response15.data) !== null && _e$response15$data !== void 0 && _e$response15$data.message) {\n          console.error(e.response.data.message);\n        }\n      }\n    }\n  }\n  async addMessageAPI(message) {\n    try {\n      await MessageService.addMessage(message).then();\n    } catch (e) {\n      var _e$response16, _e$response16$data;\n      if ((_e$response16 = e.response) !== null && _e$response16 !== void 0 && (_e$response16$data = _e$response16.data) !== null && _e$response16$data !== void 0 && _e$response16$data.message) {\n        console.error(e.response.data.message);\n      }\n    }\n  }\n  async updateMessageAPI(message) {\n    try {\n      await MessageService.updateMessage(message).then();\n    } catch (e) {\n      var _e$response17, _e$response17$data;\n      if ((_e$response17 = e.response) !== null && _e$response17 !== void 0 && (_e$response17$data = _e$response17.data) !== null && _e$response17$data !== void 0 && _e$response17$data.message) {\n        console.error(e.response.data.message);\n      }\n    }\n  }\n  async deleteMessagesAPI(shortMessagesCollection) {\n    try {\n      await MessageService.deleteMessages(shortMessagesCollection).then();\n    } catch (e) {\n      var _e$response18, _e$response18$data;\n      if ((_e$response18 = e.response) !== null && _e$response18 !== void 0 && (_e$response18$data = _e$response18.data) !== null && _e$response18$data !== void 0 && _e$response18$data.message) {\n        console.error(e.response.data.message);\n      }\n    }\n  }\n}","map":{"version":3,"names":["makeAutoObservable","UserService","AuthService","ChatService","MessageService","axios","refreshToken","ContentService","ContactService","Store","constructor","isAuth","profile","chats","currentDialog","viewedDialogId","contacts","viewedUserProfile","viewedUserProfileId","uploadedContentForChats","dialogInput","isLoading","isError","getAuth","getLoading","logout","removeTokensTolLocalStorage","setAuth","setProfile","bool","getProfile","getChats","setChats","getCurrentDialog","setCurrentDialog","getViewedDialogId","setViewedDialogId","getUploadedContentForChats","setUploadedContentForChats","uploaded","getDialogInput","setDialogInput","getViewedUserProfile","setViewedUserProfile","getViewedUserProfileId","setViewedUserProfileId","getContacts","setContacts","setLoading","setIsError","getIsError","setTokensTolLocalStorage","response","localStorage","setItem","process","env","REACT_APP_NAME_TOKEN","data","token","REACT_APP_NAME_REFRESH_TOKEN","refresh_token","removeItem","getProfileFromAPI","e","signIn","request","setTimeout","signUp","forgotPassword","checkAuth","post","getItem","getChatsFromAPI","getChatsList","then","res","message","console","error","deleteProfileFromAPI","deleteProfile","request_status","updateProfileFromAPI","profileRequest","updateProfile","status","uploadAvatar","file","formData","FormData","append","profileContents","items","content","slice","push","deleteUserAvatarFromAPI","index","deleteContent","id","avatar","splice","deleteChatAvatarFromAPI","chatsListItem","forEach","chat","indexChat","getContactsFromAPI","addContactFromAPI","contactId","addContact","contactsList","acceptContactFromAPI","contact","acceptContact","deleteContactFromAPI","deleteContact","getDialogOrNewFromAPI","otherUser","getDialogOrNew","chatsList","flag","item","getNewMultiDialogFromAPI","chatRequest","name","nickname","getNewMultiDialog","deleteChatFromAPI","deleteChat","toString","chatItem","log","uploadFiles","collectionFiles","chatId","chatsWithUploaded","uploadedContent","map","type","includes","uploadImage","uploadFile","deleteUploadedContent","contentId","contentListItem","tempUploadedContent","addMessageAPI","addMessage","updateMessageAPI","updateMessage","deleteMessagesAPI","shortMessagesCollection","deleteMessages"],"sources":["/data/messenger.client/src/store/store.ts"],"sourcesContent":["import {makeAutoObservable} from \"mobx\";\nimport SignInRequest from \"../models/request/SignInRequest\";\nimport SignUpRequest from \"../models/request/SignUpRequest\";\nimport {UserService, AuthService, ChatService, MessageService} from \"../services/\";\nimport {UserListItem} from \"../models/response/UserListItem\";\nimport axios, {AxiosResponse} from \"axios\";\nimport {AuthResponse} from \"../models/response/AuthResponse\";\nimport {refreshToken} from \"../routes\";\nimport ForgotPasswordRequest from \"../models/request/ForgotPasswordRequest\";\nimport {ChatsListResponse} from \"../models/response/ChatsListResponse\";\nimport {ChatsListItem} from \"../models/response/ChatsListItem\";\nimport ProfileRequest from \"../models/request/ProfileRequest\";\nimport {ContentListItem} from \"../models/response/ContentListItem\";\nimport ContentService from \"../services/ContentService\";\nimport {ContentListResponse} from \"../models/response/ContentListResponse\";\nimport {ContactListResponse} from \"../models/response/ContactListResponse\";\nimport ContactService from \"../services/ContactService\";\nimport {ContactListItem} from \"../models/response/ContactListItem\";\nimport {ShortChatList} from \"../models/uploadedStoreModel/ShortChatList\";\nimport {InputTextList} from \"../models/inputDialogModel/InputTextList\";\nimport MessageRequest from \"../models/request/MessageRequest\";\nimport UpdateMessageItem from \"../models/request/UpdateMessageItem\";\nimport {MessagesShortListRequest} from \"../models/request/MessagesShortListRequest\";\nimport ChatRequest from \"../models/request/ChatRequest\";\n\nexport default class Store {\n    private isAuth: boolean = false;\n    public profile = {} as UserListItem;\n    public chats = {} as ChatsListResponse;\n    public currentDialog = {} as ChatsListItem;\n    public viewedDialogId: number | null = null;\n    public contacts = {} as ContactListResponse;\n    private viewedUserProfile = {} as UserListItem;\n    public viewedUserProfileId: string | null = null;\n    public uploadedContentForChats = {} as ShortChatList;\n    public dialogInput = {} as InputTextList;\n    private isLoading: boolean = false;\n    private isError: boolean = false;\n\n    public constructor() {\n        makeAutoObservable(this);\n    }\n\n    private setAuth(bool: boolean): void {\n        this.isAuth = bool;\n    }\n\n    public getAuth: () => boolean = () => {\n        return this.isAuth;\n    }\n\n    public getProfile(): UserListItem {\n        return this.profile;\n    }\n\n    public setProfile(profile: UserListItem): void {\n        this.profile = profile;\n    }\n\n    public getChats(): ChatsListResponse {\n        return this.chats;\n    }\n\n    private setChats(chats: ChatsListResponse): void {\n        this.chats = chats;\n    }\n\n    public getCurrentDialog(): ChatsListItem {\n        return this.currentDialog;\n    }\n\n    public setCurrentDialog(currentDialog: ChatsListItem): void {\n        this.currentDialog = currentDialog;\n    }\n\n    public getViewedDialogId(): number | null {\n        return this.viewedDialogId;\n    }\n\n    public setViewedDialogId(viewedDialogId: number | null): void {\n        this.viewedDialogId = viewedDialogId;\n    }\n\n    public getUploadedContentForChats(): ShortChatList {\n        return this.uploadedContentForChats;\n    }\n\n    public setUploadedContentForChats(uploaded: ShortChatList): void {\n        this.uploadedContentForChats = uploaded;\n    }\n\n    public getDialogInput(): InputTextList {\n        return this.dialogInput;\n    }\n\n    public setDialogInput(dialogInput: InputTextList): void {\n        this.dialogInput = dialogInput;\n    }\n\n    public getViewedUserProfile(): UserListItem {\n        return this.viewedUserProfile;\n    }\n\n    public setViewedUserProfile(viewedUserProfile: UserListItem): void {\n        this.viewedUserProfile = viewedUserProfile;\n    }\n\n    public getViewedUserProfileId(): string | null {\n        return this.viewedUserProfileId;\n    }\n\n    public setViewedUserProfileId(viewedUserProfileId: string | null): void {\n        this.viewedUserProfileId = viewedUserProfileId;\n    }\n\n    public getContacts(): ContactListResponse {\n        return this.contacts;\n    }\n\n    public setContacts(contacts: ContactListResponse): void {\n        this.contacts = contacts;\n    }\n\n    private setLoading(bool: boolean): void {\n        this.isLoading = bool;\n    }\n\n    public getLoading: () => boolean = () => {\n        return this.isLoading;\n    }\n\n    public setIsError(bool: boolean): void {\n        this.isError = bool;\n    }\n\n    public getIsError(): boolean {\n        return this.isError;\n    }\n\n    public setTokensTolLocalStorage(response: AxiosResponse<AuthResponse>): void {\n        localStorage.setItem(\n            `${process.env.REACT_APP_NAME_TOKEN}`,\n            response.data.token\n        );\n        localStorage.setItem(\n            `${process.env.REACT_APP_NAME_REFRESH_TOKEN}`,\n            response.data.refresh_token\n        );\n    }\n\n    public removeTokensTolLocalStorage(): void {\n        localStorage.removeItem(`${process.env.REACT_APP_NAME_TOKEN}`);\n        localStorage.removeItem(`${process.env.REACT_APP_NAME_REFRESH_TOKEN}`);\n    }\n\n    public async getProfileFromAPI() {\n        try {\n            const response = await UserService.profile();\n            this.setProfile(response.data);\n        } catch (e) {\n            this.removeTokensTolLocalStorage();\n        }\n    }\n\n    public async signIn(request: SignInRequest) {\n        try {\n            const response = await AuthService.signIn(request);\n            this.setTokensTolLocalStorage(response);\n            this.setAuth(true);\n            await this.getProfileFromAPI();\n        } catch (e) {\n            this.setIsError(true);\n        } finally {\n            setTimeout(() => {\n                this.setIsError(false);\n            }, 5000);\n        }\n    }\n\n    public async signUp(request: SignUpRequest) {\n        try {\n            const response = await AuthService.signUp(request);\n            this.setTokensTolLocalStorage(response);\n            this.setAuth(true);\n            await this.getProfileFromAPI();\n        } catch (e) {\n            this.setIsError(true);\n        } finally {\n            setTimeout(() => {\n                this.setIsError(false);\n            }, 5000);\n        }\n    }\n\n    public async forgotPassword(request: ForgotPasswordRequest) {\n        try {\n            await AuthService.forgotPassword(request);\n        } catch (e) {\n            this.setIsError(true);\n        }\n    }\n\n     public logout = (): void => {\n        this.removeTokensTolLocalStorage();\n        this.setAuth(false);\n        this.setProfile({} as UserListItem);\n    }\n\n    public async checkAuth() {\n        this.setLoading(true);\n        try {\n            const response = await axios.post<AuthResponse>(\n                refreshToken(),\n                {\n                    \"refresh_token\": localStorage.getItem(`${process.env.REACT_APP_NAME_REFRESH_TOKEN}`)\n                }\n            );\n            this.setTokensTolLocalStorage(response);\n            this.setAuth(true);\n            await this.getProfileFromAPI();\n        } catch (e) {\n            this.removeTokensTolLocalStorage();\n            this.setIsError(true);\n        } finally {\n            this.setLoading(false);\n        }\n    }\n\n    public async getChatsFromAPI() {\n        try {\n            return await ChatService.getChatsList().then((res: any) => (\n                this.setChats(res.data)\n            ));\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async deleteProfileFromAPI() {\n        try {\n            this.setLoading(true);\n            await UserService.deleteProfile().then((res: any) => {\n                if (res.data.request_status!) {\n                    this.logout();\n                }\n            });\n\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        } finally {\n            this.setLoading(false);\n        }\n    }\n\n    public async updateProfileFromAPI(profileRequest: ProfileRequest) {\n        try {\n            await UserService.updateProfile(profileRequest).then((res: any) => {\n                if (res.status === 200) {\n                    this.setProfile({\n                        ...this.getProfile(),\n                        ...res.data\n                    });\n                    this.setIsError(false);\n                }\n            });\n\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                this.setIsError(true);\n                console.error(e.response.data.message);\n            }\n        } finally {\n            setTimeout(() => {\n                this.setIsError(false);\n            }, 5000);\n        }\n    }\n\n    public async uploadAvatar(file: File) {\n        try {\n            const formData: FormData = new FormData();\n            formData.append('avatar', file);\n\n            await UserService.uploadAvatar(formData).then((res) => {\n                if (res.status === 200) {\n                    const profileContents: ContentListResponse = {\n                        items: this.getProfile().content?.items.slice() || []\n                    };\n\n                    // @ts-ignore\n                    profileContents.items.push(res.data);\n\n                    this.setProfile({\n                        ...this.getProfile(),\n                        content: profileContents\n                    });\n                }\n            });\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async deleteUserAvatarFromAPI(data: ContentListItem, index: number) {\n        try {\n            await ContentService.deleteContent(data).then((res: any) => {\n                if (\n                    res.status === 200 &&\n                    data.id &&\n                    data.avatar &&\n                    this.getProfile().content?.items\n                ) {\n                    const profileContents: ContentListResponse = {\n                        items: this.getProfile().content?.items.slice() || []\n                    };\n\n                    profileContents.items.splice(index, 1);\n\n                    this.setProfile({\n                        ...this.getProfile(),\n                        content: profileContents\n                    });\n                }\n            });\n\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async deleteChatAvatarFromAPI(data: ContentListItem, index: number, chatsListItem: ChatsListItem) {\n        try {\n            await ContentService.deleteContent(data).then((res: any) => {\n                if (res.status === 200 && data.id && data.avatar) {\n                    const chats: ChatsListResponse = {\n                        items: this.getChats().items.slice() || []\n                    };\n\n                    chats.items.forEach((chat, indexChat) => {\n                        if (chatsListItem.id === chat.id) {\n                            chats.items[indexChat].content?.items.splice(index, 1);\n                        }\n                    });\n\n                    this.setChats({\n                        ...this.getChats(),\n                        items: chats.items\n                    });\n                }\n            });\n\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async getContactsFromAPI() {\n        try {\n            await ContactService.getContacts().then((res: any) => {\n                if (res.status === 200) {\n                    this.setContacts({\n                        ...this.getContacts(),\n                        ...res.data\n                    });\n                }\n            });\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async addContactFromAPI(contactId: string) {\n        try {\n            await ContactService.addContact(contactId).then((res) => {\n                if (res.status === 200) {\n                    const contactsList: ContactListResponse = {\n                        items: this.getContacts().items.slice() || []\n                    };\n\n                    // @ts-ignore\n                    contactsList.items.push(res.data);\n\n                    this.setContacts({\n                        ...this.getContacts(),\n                        ...contactsList\n                    });\n                }\n            });\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async acceptContactFromAPI(contact: ContactListItem, index: number) {\n        try {\n            if (contact.id) {\n                await ContactService.acceptContact(contact.id).then((res) => {\n                    if (res.status === 200) {\n                        const contactsList: ContactListResponse = {\n                            items: this.getContacts().items.slice() || []\n                        };\n\n                        if (contactsList.items[index]) {\n                            contactsList.items[index].status = true;\n                        }\n\n                       this.setContacts({\n                            ...this.getContacts(),\n                            ...contactsList\n                        });\n                    }\n                });\n            }\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async deleteContactFromAPI(contact: ContactListItem, index: number) {\n        try {\n            if (contact.id) {\n                await ContactService.deleteContact(contact.id).then((res) => {\n                    if (res.status === 200) {\n                        const contactsList: ContactListResponse = {\n                            items: this.getContacts().items.slice() || []\n                        };\n\n                        contactsList.items.splice(index, 1);\n\n                        this.setContacts({\n                            ...this.getContacts(),\n                            ...contactsList\n                        });\n                    }\n                });\n            }\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async getDialogOrNewFromAPI(otherUser: UserListItem) {\n        try {\n            let chat = {} as ChatsListItem;\n\n            await ChatService.getDialogOrNew(otherUser.id).then((res) => {\n                if (res.status === 200) {\n                    const chatsList: ChatsListResponse = {\n                        items: this.getChats().items.slice() || []\n                    };\n                    let flag: boolean = false;\n\n                    chatsList.items.forEach((item) => {\n                        if (item.id === res.data.id) {\n                            chat = item;\n                            flag = true;\n                        }\n                    });\n\n                    if (!flag) {\n                        // @ts-ignore\n                        chatsList.items.push(res.data);\n                        this.setChats({\n                            ...this.getChats(),\n                            ...chatsList\n                        });\n                        chat = res.data;\n                    }\n                }\n            });\n            return chat;\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async getNewMultiDialogFromAPI() {\n        let chatRequest = {} as ChatRequest;\n        chatRequest.name = `new MultiDialog By ${(this.getProfile().nickname)? this.getProfile().nickname: ''}`;\n\n        try {\n            await ChatService.getNewMultiDialog(chatRequest).then((res) => {\n                if (res.status === 200) {\n                    let chatsList: ChatsListResponse = {\n                        items: this.getChats().items.slice() || []\n                    };\n                    // @ts-ignore\n                    chatsList.items.push(res.data);\n\n                    this.setChats({\n                        ...this.getChats(),\n                        ...chatsList\n                    });\n                }\n            });\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async deleteChatFromAPI(chat: ChatsListItem) {\n        try {\n            await ChatService.deleteChat(chat.id.toString()).then((res) => {\n                if (res.status === 200) {\n                    let chatsList: ChatsListResponse = {\n                        items: this.getChats().items.slice() || []\n                    };\n\n                    chatsList.items.forEach((chatItem, indexChat) => {\n                        if (chatItem.id === chat.id) {\n                            console.log(true)\n                            chatsList.items.splice(indexChat, 1);\n                        }\n                    });\n\n                    console.log(chatsList)\n\n                    if (this.getViewedDialogId()! === chat.id) {\n                        this.setViewedDialogId(null);\n                    }\n\n                    if (this.getCurrentDialog().id === chat.id) {\n                        this.setCurrentDialog({} as ChatsListItem);\n                    }\n\n                    this.setChats({\n                        ...this.getChats(),\n                        ...chatsList\n                    });\n                }\n            });\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async uploadFiles(collectionFiles: File[]) {\n        try {\n            const chatId: number = this.getViewedDialogId() || 0;\n\n            let chatsWithUploaded = {\n                items: (this.getUploadedContentForChats().items)?\n                    this.getUploadedContentForChats().items.slice():\n                    []\n            } as ShortChatList;\n\n            if (!chatsWithUploaded.items[chatId]) {\n                chatsWithUploaded.items[chatId] = {\n                    uploadedContent: {\n                        items: []\n                    }\n                }\n            }\n\n            collectionFiles.map(async (file: File) => {\n                const formData: FormData = new FormData();\n\n                if (file.type.includes(\"image\")) {\n                    formData.append('image', file);\n\n                    await ContentService.uploadImage(formData).then((res) => {\n                        if (res.status === 200) {\n                            // @ts-ignore\n                            chatsWithUploaded.items[chatId].uploadedContent.items.push(res.data);\n\n                            this.setUploadedContentForChats({\n                                ...this.getUploadedContentForChats(),\n                                ...chatsWithUploaded\n                            });\n                        }\n                    });\n                } else {\n                    formData.append('file', file);\n\n                    await ContentService.uploadFile(formData).then((res) => {\n                        if (res.status === 200) {\n                            // @ts-ignore\n                            chatsWithUploaded.items[chatId].uploadedContent.items.push(res.data);\n\n                            this.setUploadedContentForChats({\n                                ...this.getUploadedContentForChats(),\n                                ...chatsWithUploaded\n                            });\n                        }\n                    });\n                }\n            });\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async deleteUploadedContent(chatId: number, contentId: string) {\n        let contentListItem = {} as ContentListItem;\n        const tempUploadedContent: ShortChatList = (this.getUploadedContentForChats())?\n            {...this.getUploadedContentForChats()}:\n            {items: []};\n\n        if (tempUploadedContent.items[chatId]) {\n            tempUploadedContent.items[chatId].uploadedContent.items.forEach((item: ContentListItem, index) => {\n                if (item.id === contentId) {\n                    contentListItem = {...item};\n                    tempUploadedContent.items[chatId].uploadedContent.items.splice(index, 1);\n                }\n            });\n        }\n\n        this.setUploadedContentForChats({\n            ...this.getUploadedContentForChats(),\n            ...tempUploadedContent\n        });\n\n        if (contentListItem) {\n            try {\n                await ContentService.deleteContent(contentListItem).then();\n\n            } catch (e: any) {\n                if (e.response?.data?.message!) {\n                    console.error(e.response.data.message);\n                }\n            }\n        }\n    }\n\n    public async addMessageAPI(message: MessageRequest) {\n        try {\n            await MessageService.addMessage(message).then();\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async updateMessageAPI(message: UpdateMessageItem) {\n        try {\n            await MessageService.updateMessage(message).then();\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n\n    public async deleteMessagesAPI(shortMessagesCollection: MessagesShortListRequest) {\n        try {\n            await MessageService.deleteMessages(shortMessagesCollection).then();\n        } catch (e: any) {\n            if (e.response?.data?.message!) {\n                console.error(e.response.data.message);\n            }\n        }\n    }\n}"],"mappings":"AAAA,SAAQA,kBAAkB,QAAO,MAAM;AAGvC,SAAQC,WAAW,EAAEC,WAAW,EAAEC,WAAW,EAAEC,cAAc,QAAO,cAAc;AAElF,OAAOC,KAAK,MAAuB,OAAO;AAE1C,SAAQC,YAAY,QAAO,WAAW;AAMtC,OAAOC,cAAc,MAAM,4BAA4B;AAGvD,OAAOC,cAAc,MAAM,4BAA4B;AASvD,eAAe,MAAMC,KAAK,CAAC;EAchBC,WAAW,GAAG;IAAA,KAbbC,MAAM,GAAY,KA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